/** Exception class ------------------------------------------------------**/
/** From http://loulou.developpez.com/tutoriels/moteur3d/partie1/#L2.1
**/

#ifndef EXCEPTION_H_
#define EXCEPTION_H_

#include <exception>
#include <string>

namespace BPL
{
class Exception : public std::exception
{
public :

    Exception(const std::string& message = "");
    virtual ~Exception() throw();

    virtual const char* what() const throw();

protected :
    std::string mpt_message;
};
}

struct AssertException : public BPL::Exception
{
    AssertException(const std::string& file, int line, const std::string& message);
};

#define Assert(condition) if (!(condition)) throw AssertException(__FILE__, __LINE__, "Condition non satisfaite\n\n" #condition)

struct LoadingFailed : public BPL::Exception
{
    LoadingFailed(const std::string& file, const std::string& message);
};


#endif
